/**
 * Created by Jie on 2017/2/3.
 */
var Desktop = require('../../model/core/desktop');
var data = require('../../util/result');
var session = require('express-session');

exports.index = function (req,res) {
    res.render('index',
        {
            title: 'OS 管理平台'
        });
};

exports.menu = function (req,res) {
    var desktop = new Desktop();
    desktop.menu(req.session.user,function(err,result){
        if(err){
            res.json(data.result(1,"error"));
        }
        res.json(data.result(0,"ok",(result.length === 1 ? result[0]:result)));
    });
}